const {contextBridge, desktopCapturer, ipcRenderer} = require("electron");

contextBridge.exposeInMainWorld('sohoApi', {
    setMinimize: () => ipcRenderer.invoke('minimize-window'),
    setMaximize: () => ipcRenderer.invoke('maximize-window'),
    setClose: () => ipcRenderer.invoke('close-window'),
    setHide: () => ipcRenderer.invoke('hide-window'),
    setShow: () => ipcRenderer.invoke('show-window'),
    send: (eventName, data) => {
        ipcRenderer.send(eventName, data)
    },
    onMessage: (name, callback)=>{
        ipcRenderer.addListener(name, callback);
    },
    offMessage: (name, callback)=>{
        ipcRenderer.removeListener(name, callback);
    },
    offAllMessage: (name)=>{
        ipcRenderer.removeAllListeners(name);
    },
})
